home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
utility.lha
/
utility
/
listiter.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-08
|
659b
|
32 lines
// Generic list iterator (implementation module).
//
// It is a good idea to have an index into the pointer array, rather
// than a pointer. If some fool inserts an element while iterating
// over the list, the pointer array may be reallocated. The index
// version still works.
//
// Author:
//
// Dag Bruck, Department of Automatic Control, Lund Institute of Technology,
// Box 118, S-221 00 Lund, Sweden (dag@control.lth.se).
//
// $Id: listiter.C,v 1.3 91/09/06 17:03:42 dag Exp $
#include <listiter.H>
void GenericIterator :: Rewind()
{
i = 0;
}
void GenericIterator :: Skip(int di)
{
if (di + int(i) < 0)
Rewind();
else
i += di;
}